//+------------------------------------------------------------------+
//|                                                    OrderList.mqh |
//|                               Copyright 2016, STW Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, STW Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
#include <Order.mqh>
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
class OrderList
  {
private:
   static OrderList *instance;
   Order            *List[];
   int               Size;
public:
                     OrderList(){};
                    ~OrderList(){};
   static OrderList*GetInstance()
     {
      if(instance==NULL)
        {
         instance=new OrderList();
        }
      return instance;
     }

   int Add(Order &Value)
     {
      Size=ArraySize(List);
      Size=Size+1;
      ArrayResize(List,Size);
      int IndexId=Size-1;
      List[IndexId]=GetPointer(Value);
      return IndexId;
     }
   Order*GetByIndex(int IndexId)
     {
      return List[IndexId];
     }

   int GetSize()
     {
      return Size;
     }
  };
//+------------------------------------------------------------------+
OrderList *OrderList::instance=NULL;
//+------------------------------------------------------------------+
